//解锁翻页
try {
    setCookie('newpresentview', parseInt(document.querySelector('#pagesnumber').innerText.split('共')[1].split('页')[0]));
} catch (error) {

}

//提交练习
try {
    function btnAddExam() {
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "/ExamCourse/SaveOnlinePractice",
            data: {
                "tid": getValue("tid"),
                "cid": cid,
                "uid": sessionStorage.getItem("UserId")
            },
            success: function (result) {
                var obj = result;
                if (obj.StatusCode == "0000") {
                    layer.msg("提交成功");
                    delaygoto("/LearningCenter/eBookDetails/?eid=" + eid);
                } else {
                    layer.msg(result.Info);
                }
            }
        });
    }
    document.querySelector('.submitBtn').click()
} catch (error) {

}

//考试
try {
    ["#div_singleList ", "#div_checkList ", "#div_judgeList "].forEach((v) => {
        document.querySelectorAll(v + 'ul').forEach((v) => {
            v.querySelectorAll('li input').forEach((sel) => {
                if (sel.getAttribute('data-iscorrect') === "1") {
                    sel.dispatchEvent(new MouseEvent('click', {
                        view: window,
                        bubbles: true,
                        cancelable: true
                    }))
                }
            })
        })
    });
} catch (error) {

}